<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0"/>
    <title>背景图片-1</title>
<style>
div{
    width:100%;
    height:400px;
    border:2px solid red;
    background:url('xi.jpg') no-repeat;
   /* background-size:contain; 背景图片将按比例自适应内容区域，图片保持其比例不变 */
    background-size:100% 100%;
}
</style>
</head>
<body>
<p>调整浏览器大小查看效果。</p>
<div></div>
</body>
</html>